package com.shangguigu.spirngioc.ioc.config;

import com.shangguigu.spirngioc.ioc.Service.UserService;
import com.shangguigu.spirngioc.ioc.bean.Dog;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DogConfig {

//    @ConditionalOnMissingBean(value = UserService.class)
    @ConditionalOnBean(value = UserService.class)
    @Bean
    public Dog dog(){
        return new Dog();
    }
}
